/*
模拟一个简单的计算器
*/
public class Test19 {
    public static void main(String[] args) {
        Number a1 =new Number();
        a1.setN1(10);
        a1.setN2(5);
        a1.Add();
        a1.Sub();
        a1.Mul();
        a1.Div();
    }
}
class Number {
    private int n1;
    private int n2;

    public Number() {
    }

    public void Number(int n1, int n2) {
        this.n1 = n1;
        this.n2 = n2;
    }

    //n1变量读写入口
    public void setN1(int n1) {
        this.n1 = n1;
    }

    public int getN1() {
        return n1;
    }

    //n2变量读写入口
    public void setN2(int n2) {
        this.n2 = n2;
    }

    public int getN2() {
        return n2;
    }

    //加计算方法
    public void Add() {
        int add = this.getN1() + this.getN2();
        System.out.println(this.getN1()+"+"+this.getN2()+"="+add);
    }
    //计算减方法
    public void Sub(){
        int sub =this.getN1()-this.getN2();
        System.out.println(this.getN1()+"-"+this.getN2()+"="+sub);
    }
    //计算乘方法
    public void Mul(){
        int mul =this.getN1()*this.getN2();
        System.out.println(this.getN1()+"*"+this.getN2()+"="+mul);
    }
    //计算除方法
    public void Div(){
        int div =this.getN1()/this.getN2();
        if (this.getN1()%this.getN2() != 0){
            System.out.println("这两个数字不能整除！！！");
            return;
        }
        System.out.println(this.getN1()+"/"+this.getN2()+"="+div);
    }
}
